package com.mark.mall.web.platform.myMethod;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.SqlSource;


/**
 * @author admin
 */
public class FindAll extends AbstractMethod {


    @Override
    public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) {
        String sql = "select " + tableInfo.getAllSqlSelect() + " from " + tableInfo.getTableName();
        String method = "findAll";
        SqlSource sqlSource = languageDriver.createSqlSource(configuration,sql,modelClass);
        return addSelectMappedStatementForTable(mapperClass, method, sqlSource, tableInfo);
    }
}
